package com.wolf.gulimall.auth.feign;

import com.wolf.common.utils.R;
import com.wolf.gulimall.auth.vo.SocialUserVo;
import com.wolf.gulimall.auth.vo.UserLoginVo;
import com.wolf.gulimall.auth.vo.UserRegisteredVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 远程调用会员服务
 */
@FeignClient("gulimall-member")
public interface MemberFeignService {

    /**
     * 注册新用户
     * @param userRegisteredVo 用户注册信息
     * @return 书册是否成功
     */
    @PostMapping("/member/member/registered")
    R registered(@RequestBody UserRegisteredVo userRegisteredVo);

    /**
     * 用户登录
     * @param userLoginVo 登录信息
     * @return 是否登录成功
     */
    @PostMapping("/member/member/login")
    R login(@RequestBody UserLoginVo userLoginVo);

    /**
     * 社交用户登录
     * @param socialUserVo 社交登录信息
     * @return 是否登录成功
     */
    @PostMapping("/member/member/oauth2/login")
    R login(@RequestBody SocialUserVo socialUserVo) throws Exception;
}
